load TagBlock,AttachData,ListBlock,References,SourceButtons

! all INDIAttributes
#eventTag=@contents

#tagKey=#eventTag&" details"
Title @this.altview&" - "&local(#tagKey)
cell GroupBox,local(#tagKey)
  width -1
  SetTab 120

  ! show date and place
  if #eventTag="RESI"
    NewLine
    cell static,local("DATE")&":"
    set tabwidth 1 alignment right
    cell expression,@parent.DATE
    set Width -1 AppendedExpression view

    NewLine
    cell static,local("PLAC")&":"
    set tabwidth 1 alignment right
    cell expression,@parent.PLAC
    set Width -1
  else
    ! static text attribute description
    NewLine
    cell static,local("Description")&":"
    set tabwidth 1 alignment right
    cell expression,@parent
    set Width -1

    if #oneTable="yes"
      NewLine
      cell static,local("DATE")&":"
      set tabwidth 1 alignment right
      cell expression,@parent.DATE
      set Width -1 AppendedExpression view
    else
      Show DATE
    endif
    Show PLAC
  endif
  ShowAll TYPE
  Show ADDR
  ShowAll PHON
  ShowAll EMAIL
  ShowAll FAX
  ShowAll WWW
  ShowAll _GPS
  Show AGE
  ShowAll CAUS
  ShowAll AGNC
  ShowAll RELI details
  if RESN is Here
    Show RESN "menu"
  endif

EndGroup

! --------- NOTEs, SOURs, and OBJEs -----------
gosub TagBlock,"OBJE",local("Multimedia")
#numSOURs=@count.SOUR
gosub References,"_LOG"

! --------- Attach links
newline
cell GroupBox,local("Attach")
  width -1
  newline -#lineSkip-3
  #lineSkip=0
  Show NOTE
  Show SOUR
  Show OBJE
  Show _LOG
  GoSub AttachData
  GoSub SourceButtons,"true",#numSOURs
EndGroup
#lineSkip=#lineSkip$

optionaltag AGNC,local("AGNC"),local("AGNC")
optionaltag CAUS,local("CAUS"),local("CAUS")
optionaltag TYPE,local("TYPE"),local("TYPE")
optionaltag PHON,local("PHON"),local("PHON")
optionaltag EMAIL,local("EMAIL"),""
optionaltag FAX,local("FAX"),""
optionaltag WWW,local("WWW"),""
optionaltag _GPS,local("_GPS"),""
optionalTag RESN,local("RESN"),""
optionalTag RELI,local("RELI"),""

resizeWindow yes
